﻿
using System;
using System.Windows.Forms;

namespace GDFlacTool.Forms
{
    public partial class FormPasteTag : Form
    {
        private readonly int _numberOfTracks;

        public FormPasteTag(int numberOfTracks)
        {
            InitializeComponent();

            _numberOfTracks = numberOfTracks;
        }

        public bool DontPasteTitleField
        {
            get { return chkPasteTitleField.Checked; }
        }

        public bool DontPasteTrackField
        {
            get { return chkPasteTrackField.Checked; }
        }

        public bool DontPasteDiscField
        {
            get { return chkPasteDiscField.Checked; }
        }

        public bool DontPasteBpmField
        {
            get { return chkPasteBpmField.Checked; }
        }

        public bool DontPasteLyricsField
        {
            get { return chkPasteLyricsField.Checked; }
        }

        public bool DontPasteArtistField
        {
            get { return chkPasteArtistField.Checked; }
        }

        private void btnCheckAll_Click(object sender, EventArgs e)
        {
            foreach (var control in Controls)
            {
                if(control.GetType() == typeof(CheckBox))
                {
                    ((CheckBox) control).Checked = true;
                }
            }
        }

        private void btnUncheckAll_Click(object sender, EventArgs e)
        {
            foreach (var control in Controls)
            {
                if (control.GetType() == typeof(CheckBox))
                {
                    ((CheckBox)control).Checked = false;
                }
            }
        }

        private void FormPasteTag_Load(object sender, EventArgs e)
        {
            Text = string.Format("Paste Tag to {0} File(s)", _numberOfTracks);
        }
    }
}
